package com.example.speedwaymanager;

import android.graphics.Color;
import android.provider.CalendarContract.Colors;

public class CGate {

	EColors _color;
	int _no;

	public CGate(String no, String color) {
		_no = Integer.parseInt(no);
		_color = translateColor(color);
	}

	public int translateColor(EColors color)
	{
		int retCol = 0;
		switch (color)
		{
		case eRed:
			retCol = Color.RED;
			break;
		case eBlue:
			retCol = Color.BLUE;
			break;
		case eWhite:
			retCol = Color.rgb(94, 94, 83);
			break;
		case eYellow:
			retCol = Color.rgb(182, 188, 26);
			break;
		default:
			retCol = Color.GRAY;
			break;
		}
		return retCol;
	}
	
	private EColors translateColor(String col) {
		if (col.equals("Z"))
			return EColors.eYellow;
		if (col.equals("C"))
			return EColors.eRed;
		if (col.equals("N"))
			return EColors.eBlue;
		if (col.equals("B"))
			return EColors.eWhite;
		return EColors.eNone;
	}
	
	public String toString()
	{
		return Integer.toString(_no);
	}

}
